<!DOCTYPE HTML>
<html>
<head>
    {include file='common_header'}
    <title>用户列表</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 用户管理 <span class="c-gray en">&gt;</span>用户提现管理
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href='{:Url('showlist')}');" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">

    <div class="cl pd-5 bg-1 bk-gray">
        {if condition="$Request.param.del"}
        <a href="javascript:;" onclick="delectCheck('{:Url('deleted')}',$('.item'))" class="btn btn-danger radius">
            <i class="Hui-iconfont">&#xe6e2;</i> 批量彻底删除
        </a>
        <div style="float: right"><a href="?del=0" class="btn btn-success radius"><i class="Hui-iconfont">&#xe6e2;</i> 返回</a></div>
        {else/}
        <span class="l">
        <a href="javascript:;" onclick="delectCheck('{:url('del')}',$('.item'))" class="btn btn-danger radius">
                        <i class="Hui-iconfont">&#xe6e2;</i> 批量删除
                </a>
        <!--<a href="javascript:;" onclick="layer_show('添加管理员','{:url('showadd')}','650','550')" class="btn btn-primary radius">-->
            <!--<i class="Hui-iconfont">&#xe600;</i> 添加用户-->
        <!--</a>-->
            <!--<a href="?del=1" class="btn btn-warning radius"><i class="Hui-iconfont">&#xe6e2;</i>  回收站</a>-->

        </span>

        <div style="float: right">
            <span  style="margin-left:14px;" class="text-c">
            <label>申请状态：</label>
            <span class="select-box inline">
                    <select id="reviewed" class="select "  style="width: 180px">
                        <option value=""  >全部</option>
                        <option value="1"  {if condition="$reviewed eq 1"}selected{/if}>审核通过</option>
                        <option value="2" {if condition="$reviewed eq 2"}selected{/if}>待审核</option>
                        <option value="3"{if condition="$reviewed eq 3"}selected{/if}>已驳回</option>
                    </select>
                </span>
            </span>
             <input type="text" onfocus="WdatePicker()" value="{$begin}" placeholder="申请开始时间" id="begin" class="input-text Wdate" style="width:150px;">
             --
            <input type="text" onfocus="WdatePicker()"  value="{$end}" placeholder="申请结束时间" id="end"  class="input-text Wdate" style="width:150px;">
            <input type="text" class="input-text" style="width:250px" placeholder="输入用户姓名" id="keywords" value="{$Think.get.keyword}">
            <button type="button" class="btn btn-success" onclick="reload()"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
        {/if}
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr>
                <th scope="col" colspan="10"></th>
            </tr>
            <tr class="text-c">
                <th width="25"><input type="checkbox" name="" value=""></th>
                <th width="40">ID</th>
                <th width="40">用户名</th>
                <th width="90">申请金额</th>
                <th width="80">申请状态</th>
                <th width="80">申请时间</th>
                <th width="80">备注信息</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="v"}
            <tr class="text-c">
                <td><input type="checkbox" value="{$v->id}" name="" class="item"></td>
                <td>{$v->id}</td>
                <td>{$v->username}</td>
                <td>{$v->apply_money}</td>
                <td class="td-status">
                    {switch $v->reviewed}
                        {case 1}    <span class="btn btn-success radius" >审核通过</span>{/case}
                        {case 2}       <span class="btn btn-secondary radius">待审核</span>{/case}
                        {case 3}      <span class="btn btn-danger radius">已驳回</span>{/case}
                    {/switch}
               </td>
                <td>{$v->apply_time|date="Y-m-d H:i:s",###}</td>
                <td>{$v->remark}</td>
                <td class="td-manage">
                    {if condition="$v['reviewed'] eq 2"}
                        <a title="提现审核" href="javascript:;" onclick="layer_show('提现详情','{:url('showEdit',array('id'=>$v['id']))}','650','550')" class="btn btn-primary radius" style="text-decoration:none">
                            <i class="Hui-iconfont">&#xe6e1;</i>
                        </a>
                    {/if}
                    <a title="删除" href="javascript:;" onclick="delectOne('{:url('del',array('id'=>$v['id']))}',this)" class="btn btn-danger radius" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe6e2;</i>
                    </a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="page">
            {$page}
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    {include file='common_footer'}
    <!--/_footer 作为公共模版分离出去-->
</div>
</body>
<script>
    function reload() {
       var obj =$('#keywords').val();
       var begintime =$('#begin').val();
       var endtime =$('#end').val();
       var reviewed =$('#reviewed').val();
        goUrl('?keyword=' + obj+"&begin="+begintime+"&end="+endtime+'&reviewed='+reviewed);
    }
    /*管理员-重置密码*/
    function referpass(id){
        layer.confirm('确认要将密码重置为a123456吗？',function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('referpass')}",
                data:{id:id},
                dataType: 'json',
                success: function(){
                    layer.msg('密码重置成功!',{icon:1,time:1000},function () {
                        location.reload();
                    });
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }
    function adminstatus(id,status) {
        if(status==1){
            $msg="确认要停用该用户吗？";
        }else{
            $msg="确认要开启该用户吗";
        }
        layer.confirm($msg,function(){
            $.ajax({
                type: 'POST',
                url: "{:url('editstatus')}",
                data:{id:id,status:status},
                dataType: 'json',
                success: function(data){
                    layer.msg(data.msg,{icon:1,time:1000},function () {
                        location.reload();
                    });
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });

    }
</script>
</html>